<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	String url = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path;
	
%> <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
    <link rel="stylesheet" href="<%=basePath%>css/AdminLTE.css">
    <link rel="stylesheet" href="<%=basePath%>css/bootstrap.css">
    <link rel="stylesheet" href="<%=basePath%>css/bootstrap-table.css">
    <link rel="stylesheet" href="<%=basePath%>css/ionicons.css">
    <link rel="stylesheet" href="<%=basePath%>css/font-awesome.css">
    <link rel="stylesheet" href="<%=basePath%>css/skins/_all-skins.min.css">  
    <link rel="stylesheet" href="<%=basePath%>css/bootstrap-datetimepicker.css">
    <link rel="stylesheet" href="<%=basePath%>css/sweetalert/sweetalert.css">
    <style type="text/css">
        .font_wsg{
        font-weight:bold;        
        font-family:"微软雅黑","黑体","宋体";
        }
    </style>
</head>
<body>
<div class="row" >
<div id="customerReport" class="col-md-6"></div> 
<div id="orderReport" class="col-md-6" ></div> 
 </div>
 <div>
 <div  class="row col-md-4" style="margin:20px">
 <p id="p1" style="display:none;">截止目前，注册会员人数共有<span id="cust" class="text-red h1"></span>名</p>
 <p id="p2" style="display:none;">截止目前，营业额已达到<span id="order" class="text-red h1"></span>元</p>
 <p id="p3" style="display:none;">截止目前，人均消费达到<span id="payAvg" class="text-red h1"></span>元/次</p>
</div>
 <div  id="secret"  class="row col-md-6">
 <p id="p4" style="display:none;" class="text-red font_wsg">希望生命中有个如你一般的女生</p>
<p id="p5" style="display:none;" class="text-red font_wsg">喜欢看书，喜欢安静，喜欢小动物<p/>
<p id="p6" style="display:none;" class="text-red font_wsg">像永远面朝太阳的向日葵，内心充满了光明<p>
<p id="p7" style="display:none;" class="text-red font_wsg">多么希望能有幸撑同一把伞</p>
<p id="p8" style="display:none;" class="text-red font_wsg">由日出到夜晚，由春夏到秋冬</p>
<p id="p9"style="display:none;" class="text-red font_wsg">带你走遍沿路所有的风景</p>
 </div>
 </div>
</body>
<script src="<%=basePath%>js/jquery-2.2.3.min.js"></script>
<script src="<%=basePath%>js/bootstrap.min.js"></script>
<script src="<%=basePath%>js/bootstrap-table.js"></script>
<script src="<%=basePath%>js/jquery.easyui.min.js"></script>
<script src="<%=basePath%>js/sweetalert/sweetalert.min.js"></script>
<script src="<%=basePath%>js/locales/bootstrap-table-zh-CN.js"></script>
<script src="<%=basePath%>js/locales/easyui-lang-zh_CN.js"></script>
<script src="<%=basePath%>Charts/FusionCharts.js"></script>
<script src="<%=basePath%>js/number/jquery.animateNumber.js"></script>
<script src="<%=basePath%>js/number/jquery.color.min.js"></script>
<script type="text/javascript">

$(function(){	
	iWantTellYou();
	var customerNum =0;
	$.ajax({
  		url: "<%=basePath%>report/customerReport.do",
  		type : "post",  
		dataType:"json",
		data: null,
  		success: function(data){
  			var num=0;
  			 var pie2D = new FusionCharts( "<%=basePath%>Charts/Pie2D.swf", "myChartId", "100%", "400", "0" ); 
  			 var list = data.data;
  			 var obj;
  			var xmlData='<chart palette="4"   caption="会员统计" showBorder="0" baseFontSize="20" baseFont="微软雅黑" bgColor="#FFFFFF">';
  			 if(list.length==0){
  				xmlData+='<set label="无数据" value="0"/>';
  			 }else{
  				for(var i = 0; list && i < list.length; i++){
  					obj=list[i];
  					xmlData+='<set label="'+obj.cName+'" value="'+obj.total+'"/>';
  					num+=obj.total;
  				}
  			 }

  			xmlData+='</chart>';
  			pie2D.setXMLData(xmlData);  
            pie2D.render("customerReport"); 
            $("#p1").show();
            $('#cust').animateNumber({ number: num});
  		}
  	});
	$.ajax({
  		url: "<%=basePath%>report/orderReport.do",
  		type : "post",  
		dataType:"json",
		data: null,
  		success: function(data){
  			 var pie2D = new FusionCharts( "<%=basePath%>Charts/Pie2D.swf", "myChartId2", "100%", "400", "0" ); 
  			 var list = data.data;
  			 var obj;
  			 var num=0;
  			var xmlData='<chart palette="4" caption="消费统计" showBorder="0" baseFontSize="20" baseFont="微软雅黑" bgColor="#FFFFFF">';
  			 if(list.length==0){
  				xmlData+='<set label="无数据" value="0"/>';
  			 }else{
  				for(var i = 0; list && i < list.length; i++){
  					obj=list[i];
  					xmlData+='<set label="'+obj.cName+'" value="'+obj.total+'"/>';
  					num+=obj.total;
  				}
  			 }
  			xmlData+='</chart>';
  			pie2D.setXMLData(xmlData);  
            pie2D.render("orderReport"); 
            $("#p3").fadeIn(5000);
            $("#p2").show();
            $('#order').animateNumber({ number: num});
            $('#payAvg').append(data.payAvg);
  		}
  	});
});

function iWantTellYou(){
	var mydate = new Date();
	var year=mydate.getFullYear();
	var month=mydate.getMonth()+1;
	var day=mydate.getDate();
	if(year==2017&&month==8&&day==28){
		$("#p4").fadeIn(3000);
		$("#p5").fadeIn(6000);
		$("#p6").fadeIn(9000);
		$("#p7").fadeIn(12000);
		$("#p8").fadeIn(15000);
		$("#p9").fadeIn(18000);
	}
}


</script>
</html>